/**
 * description: promisify 回调函数封装为一部方法
 * author: 83
 * createTime: 2022-03-10 11:50:00 ?F10: AM?
 */

// promisify 模态窗
export const promisifyShowModal = (options) => {
	return new Promise((resolve, reject) => {
		uni.showModal({
			...options,
			success: resolve,
			fail: reject
		})
	})
}

// promisify 选择图片
export const promisifyChooseImage = (options) => {
	return new Promise((resolve, reject) => {
		uni.chooseImage({
			...options,
			success: resolve,
			fail: reject
		})
	})
}

// promisify 选择视频
export const promisifyChooseVideo = (options) => {
	return new Promise((resolve, reject) => {
		uni.chooseVideo({
			...options,
			success: resolve,
			fail: reject
		})
	})
}

// promisify 获取code
export const promisifyLogin = (options) => {
	return new Promise((resolve, reject) => {
		uni.login({
			...options,
			success: resolve,
			fail: reject
		})
	})
}

// promisify 获取地理位置
export const promisifyGetLocation = (options) => {
	return new Promise((resolve, reject) => {
		uni.getLocation({
			...options,
			success: resolve,
			fail: reject
		})
	})
}